import Vue from 'vue'
import VueRouter from 'vue-router'
//引入页面
// import index from "@/views/index"
// import AdminLayout from "@/views/AdminLayout";
// import Login from "@/views/Login";
// import Register from "@/views/Register";
// import Order from "@/views/Order";

Vue.use(VueRouter)
//   component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')

const routes = [
    {
        path: '/index',
        name: 'Index',
        component: () => import(/* webpackChunkName: "about" */ '../views/index'),
        meta: {
            title: '首页'
        }
    },
    // {
    //     path: '/',
    //     component:() => import(/* webpackChunkName:"AdminLayout" */ '../views/AdminLayout'),
    //     //子路由
    //     children: [
    // {
    //     path: '/',
    //     redirect: 'index'
    // },
    {
        path: '/Login',
        name: 'Login',
        component: () => import('../views/Login'),
        meta: {
            title: '用户登录'
        }
    },
    {
        path: '/Register',
        name: 'Register',
        component: () => import(/* webpackChunkName: "about" */ '../views/Register'),
        meta: {
            title: '注册'
        }
    },
    {
        path: '/Order',
        name: 'Order',
        component: () => import('../views/Order'),
        meta: {
            title: '订单'
        }
    },
    {
        path: '/Chart',
        name: 'Chart',
        component:() => import('../views/Chart'),
        meta:{
            title: '购物车'
        }
    }
    //     ]
    // }
    // {
    //   path: '/',
    //   name: 'Home',
    //   component: Home
    // },
    // {
    //   path: '/about',
    //   name: 'About',
    //   // route level code-splitting
    //   // this generates a separate chunk (about.[hash].js) for this route
    //   // which is lazy-loaded when the route is visited.
    //   component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
    // }
]

const router = new VueRouter({
    routes
})

export default router
